import React from "react"
let scaleName = {
    c: "摄氏度",
    f: "华氏度"
}
class TemperatureInput extends React.Component {

    change = (e) => {
        this.props.onChange(e.target.value)
    }
    render() {
        let { scale, temperature } = this.props
        return (
            <fieldset>
                <legend>{scaleName[scale]}</legend>
                <input type="text" value={temperature} onChange={this.change} />

            </fieldset>
        )
    }

}
export default TemperatureInput